desc "删除题目中的<p>标签."
task(:delete_p => :environment) do
  
  questions = Question.find(:all)
  Question.transaction do
    count = 0
    questions.each do |q|
      if q.description.include? "<p>" or q.description.include? "</p>"
        puts q.description
        q.description = q.description.gsub(/<p>|<\/p>/, "")
        q.save! if q.survey_id != 87
        count += 1
        puts "===> " + q.description
      end
    end
    puts "finished. #{count} questions changed."
  end
  
end
